<h1>Training <%= @test_type.name %></h1>

<p>Your emulated/virtualised session is booting. Please allow up to 30 seconds for bootup before getting worried about seeing nothing. Note that if you refresh the page before the test has completed/timed out, the emulator will still be running in the background. New sessions and tests will have to wait for the lock to be released.</p>

<p>Note that this test is currently being run on your local machine with whatever configuration is currently in the trunk/images/ directory.</p>

<table width="100%">
  <tr>
    <th>Input</th>
    <th>Output</th>
  </tr>
  <tr>
    <td width="50%" align="center">
      <div id="input" style="position:relative;height:300px;overflow:scroll;">
        <span style="color:gray;" align="center">No input as yet - type in the box below and hit &lt;enter&gt; or send.</span>
      </div>
      <%= form_remote_tag :update => 'input', :url => { :action => 'train_input', :id => @test_type.id } %>
        <input type="text" name="input" cols="50"/>
        <input type="submit" value="Send">
      </form>
    </td>
    <td width="50%" align="center">
      <div id="output" style="position:relative;height:300px;overflow:scroll;">
        <span style="color:gray;" align="center">No output as yet!</span>
      </div>
    </td>
  </tr>
</table>

<p>You can reload this page to restart the emulator. Note that there is no way to 'force kill' the emulator - it will run until it reaches it's timeout time.</p>

<p>When you have finished training the test, <%= link_to 'click here', :action => 'finish_train', :id => @test_type.id %>.</p>

<%= periodically_call_remote(
      :update => 'output',
      :url => {:controller => 'test_types', :action => 'train_input', :output => 'true', :id => @test_type.id},
      :frequency => 2 ) %>
